<div class="right_side_operate_area">
	<?php  
		$user=$session->read('User');
		$isflag=true;
		$colleageid=$session->read("colleageid");
		if($showpage==1) {
			if(isset($paging)) { echo $this->renderElement('pagination',$paging);} 
		}
	?>
   
     <?php 
    	if($isflag)
    	{
    		echo '<div class="right item_add_btn">';
			echo $html->link(__("Add",true),"/colleages/editperson/");
			echo '</div>';
		}
		else
		{
			echo '<div class="right enableaction">';
			echo "<a>添加</a>";
			echo '</div>';
		}
	?>
	
	<div class="right_side_title left">
		<h2>
		<?php 
			$colleagename=$session->read("colleagename");
			echo $html->link($colleagename,"/colleages/showcolleageinfo/".$colleageid);
			?>
		</h2>
		<div class="clear"></div>
	</div>
	
	<div class="clear"></div>
<!-- 	
	<div class="right_sidt_head_screen">
    	<div class="left">
		    <div class="right_side_head_line">
				<ul>
					<li style="width:300px">
						<div class="left screen_condition">总人数：</div>
						<div class="left screen_counts" id="totalperson">0</div>
						<div class="clear"></div>
					</li>
				</ul>
			</div>
		</div>
	</div>
 -->
 
 <div class="right_sidt_head_screen">
		<div class="right_side_head_line">
			<ul>
				<li>
					<div class="left screen_condition"><?php echo $html->link("总人数","/colleages/person")?>：</div>
					<div class="left screen_counts"><?php echo $personcount?>人</div>
					<div class="clear"></div>
				</li>
				<?php 
				foreach($colleage_title_count as $title){
					$selected="";
					if(!empty($_GET['title'])){
						if($title["key"]==$_GET['title']){
							$selected="selected";
						}
					}	
				?>
				<li class="<?php echo $selected?>">
					<div class="left screen_condition"><?php echo $html->link($title["name"],"/colleages/person?title=".$title["key"])?>：</div>
					<div class="left screen_counts"><?php echo $title["count"]?>人</div>
					<div class="clear"></div>
				</li>
				<?php }?>
				<div class="clear"></div>
			</ul>
		</div>
</div>
	
    <div class="clear"></div>
</div>


<div class="right_side_scollbar">
    <div class="detail_info_panel">
    		 <div class="items_list">
    		 		<table>
    		 				<tr>
    		 				<th>姓名</th>
    		 				<th>联系电话</th>
    		 				<th>负责方向</th>
    		 				<th>操作</th>
    		 				</tr>
    		 				
    		 				<?php
    		 						$totalperson = $urlcount;
    		 						foreach($persons as $person)
    		 						{
    		 							$id = $person["CgPerson"]["id"];
    		 							$name = $person["CgPerson"]["name"];
    		 							$direction = $person["CgPerson"]["direction"];
    		 							$tel = $person["CgPerson"]["tel"];
    		 							
    		 							$title_key = $person["CgPerson"]["title"];
    		 							foreach($colleage_titles as $key=>$colleage_title)
    		 							{
    		 								if($title_key == $key)
    		 								{
    		 									$title = $colleage_title;
    		 									break;
    		 								}
    		 							}
    		 							$name = $name.$title;
    		 							
    		 							echo "<tr class='per_list'>";
    		 							echo "<td>".$html->link($name,"/colleages/showperson/".$id,null)."</td>";
    		 							echo "<td>".$tel."</td>";
    		 							echo "<td>".$str->sub_len($direction,10)."</td>";
    		 							echo "<td>";
    		 							$email = base64_encode($person["CgPerson"]["email"]);
										if($isflag)
										{
											echo $html->link(__("Edit",true),"/colleages/editperson/".$id,null,null);
											echo $html->link(__("Delete",true),"/colleages/delperson/".$id."/".$email,array("onclick"=>"return doaction(this)"));
										}
										else
										{
											echo "<span class='enableaction'>编辑</span>";
											echo "<span class='enableaction'>删除</span>";
										}
										echo "</td>";
    		 							echo "</tr>";
    		 						}
    		 				?>
    		 		</table>
    		 		<!--<?php if($totalperson){?>
            					<script>$("#totalperson").html("<?php echo $totalperson?>");</script>
            		<?php }?>-->
    		 </div>
   	</div>
 </div>
 
 <?php echo $this->element('actionconfirm',array("title"=>"删除提示","message"=>"你确定要删除吗？")) ?>